function addformcuisinedata()
{
   $("#addform").append('<div id="feature'+rowdiv+'" class="itPlg addWrkTrckPlug featureclass">'+dataform['cuisinedata']+"</div>");
   var rownow=rowdiv;
   
      $('#feature'+rownow+' .deleterowbutton').click(function(){
   
    $('#feature'+rownow).remove();
    
   });
   
   //initialize($('#feature'+rownow+' .mapdata'));
    
   rowdiv++;
}
function saveformcuisinedata(id,plugid)
{
    var obj={};
    obj={
    plugid:plugid,
    preptime:$("#"+id+' input[name="preptime[]"]').val(),
    cooktime:$("#"+id+' input[name="cooktime[]"]').val(),
    serving:$("#"+id+' input[name="serving[]"]').val(),
    calorie:$("#"+id+' input[name="calorie[]"]').val(),
    difficulty:$("#"+id+' input[name="difficulty[]"]:checked').val(),
    cost:$("#"+id+' input[name="cost[]"]:checked').val(),
    type:$("#"+id+' input[name="type[]"]:checked').val()
    };
    return obj;

}
function getformcuisinedata(dataplugin)
{
  var arraydata=dataplugin;
  var  code  = '<div class="ldIt wrpFrmLd wrpCookLd clBg4">';
code += '<div class="wrpHdInfoGen mgBtm10">';
code += '<h2 class="clTxt2 fs04 boldGen">Cuisine Data</h2>';
code += '</div>';
code += '<table class="tbGenInfo tbFrmLd clTxt3 fs03">';
code += '<tbody><tr>';
code += '<th>Prep Time</th>';
code += '<td>'+arraydata['preptime']+'</td>';
code += '</tr>';
code += '<tr>';
code += '<th>Cook Time</th>';
code += '<td>'+arraydata['cooktime']+'</td>';
code += '</tr>';
code += '<tr>';
code += '<th>Serving</th>';
code += '<td>'+arraydata['serving']+'</td>';
code += '</tr>';
code += '<tr>';
code += '<th>Calorie</th>';
code += '<td>'+arraydata['calorie']+'</td>';
code += '</tr>';
code += '<tr>';
code += '<th>Difficulty</th>';
          var  difficulty='Expert';
            switch (arraydata['difficulty']) {
                case '1':
                difficulty='Easy';
                break;
                case '2':
                difficulty='Medium';
                break;
                case '3':
                difficulty='Hard';
                break;
                case '4':
                difficulty='Advanced';
                break;
            }

code += '<td>'+difficulty+'</td>';



code += '</tr>';
code += '<tr>';
code += '<th>Cost</th>';


difficulty='High';
            switch (arraydata['difficulty']) {
                case '1':
                difficulty='Low';
                break;
                case '2':
                difficulty='Medium-Low';
                break;
                case '3':
                difficulty='Medium';
                break;
                case '4':
                difficulty='Medium-High';
                break;
            }

code += '<td>'+difficulty+'</td>';
code += '</tr>';



code += '<tr>';
code += '<th>Type</th>';


difficulty='Free';
            switch (arraydata['type']) {
                case '2':
                difficulty='Subscribe';
                break;


            }

code += '<td>'+difficulty+'</td>';
code += '</tr>';


code += '</tbody></table>';
code += '</div>';

return code;

}
function editformcuisinedata(datarow)  
{
             addformcuisinedata();
             var rownow= rowdiv-1;

              $('#feature'+rownow+' input[name="preptime[]"]').val(datarow.preptime);
              $('#feature'+rownow+' input[name="cooktime[]"]').val(datarow.cooktime); 
              $('#feature'+rownow+' input[name="serving[]"]').val(datarow.serving);
              $('#feature'+rownow+' input[name="calorie[]"]').val(datarow.calorie);
              
              
              var $radios = $('#feature'+rownow+' input[name="difficulty[]"]');
             $radios.filter('[value='+datarow.difficulty+']').prop('checked', true);
              
              
              var $radios = $('#feature'+rownow+' input[name="cost[]"]');
              $radios.filter('[value='+datarow.cost+']').prop('checked', true);

              var $radios = $('#feature'+rownow+' input[name="type[]"]');
              $radios.filter('[value='+datarow.type+']').prop('checked', true);
              

              
            
}

